library(plyr)
library(dplyr)
library(stringr)
library(useful)
library("data.table")
library("conflicted")
library(reshape2)
conflict_prefer("mutate", "dplyr")
suppressPackageStartupMessages(library("tidyverse"))
conflict_prefer("filter", "dplyr")
library(ggplot2)
library(dplyr)
library(epiDisplay)
library(gmodels)
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:2114", "Silver:4254", "Bronze:5460"),4),
Unique_sites=c(1887, 3760, 4512, 213, 439, 603, 9, 22, 49, 5, 33, 296))
head(df2)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2114", "Silver:4254", "Bronze:5460"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.9))
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2114", "Silver:4254", "Bronze:5460"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 1), size = 10)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2114", "Silver:4254", "Bronze:5460"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.5), size = 6)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2114", "Silver:4254", "Bronze:5460"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.5), size = 4)
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5)
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5) +
theme(text = element_text(size = 10))
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5) +
theme(text = element_text(size = 12))
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5) +
theme(text = element_text(size = 14))
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:1130", "Silver:1198", "Bronze:14869"),4),
Unique_sites=c(1023, 1094, 13014, 107, 100, 1620, 0, 4, 74, 0, 0, 161))
head(df2)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:1130", "Silver:1198", "Bronze:14869"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5) +
theme(text = element_text(size = 14))
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:1130", "Silver:1198", "Bronze:14869"),4),
Unique_sites=c(1023, 1094, 13014, 107, 100, 1620, NA, 4, 74, NA, NA, 161))
head(df2)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:1130", "Silver:1198", "Bronze:14869"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5) +
theme(text = element_text(size = 14))
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:1130", "Silver:1198", "Bronze:14869"),4),
Unique_sites=c(1023, 1094, 13014, 107, 100, 1620, NA, NA, 74, NA, NA, 161))
head(df2)
# Need to add 4 to silver manually
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:1130", "Silver:1198", "Bronze:14869"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust = 0.8), size = 5) +
theme(text = element_text(size = 14))
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2822", "Silver:5730", "Bronze:10147"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  0.8), size = 5) +
theme(text = element_text(size = 14))
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:2822", "Silver:5730", "Bronze:10147"),4),
Unique_sites=c(2586, 5179, 8512, 232, 518, 1225, 3, 18, 109, 1, 15, 301))
head(df2)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2822", "Silver:5730", "Bronze:10147"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  0.8), size = 5) +
theme(text = element_text(size = 14))
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:2822", "Silver:5730", "Bronze:10147"),4),
Unique_sites=c(2586, 5179, 8512, 232, 518, 1225, 3, 18, 109, 1, 15, 301))
head(df2)
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2822", "Silver:5730", "Bronze:10147"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  0.9), size = 5) +
theme(text = element_text(size = 14))
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  0.6), size = 5) +
theme(text = element_text(size = 14))
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  1), size = 5) +
theme(text = element_text(size = 14))
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  0.8), size = 5) +
theme(text = element_text(size = 14))
df2 <- data.frame(Amino=rep(c("S", "T", "Y", "A"), each=3),
Level=rep(c("Gold:2822", "Silver:5730", "Bronze:10147"),4),
Unique_sites=c(2586, 5179, 8512, 232, 518, 1225, NA, 18, 109, 1, 15, 301))
head(df2)
# Add 3 to gold manually
ggplot(data=df2, aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity")
p <- df2 %>%
dplyr::arrange(Unique_sites) %>%
mutate(Level = factor(Level, levels=c("Gold:2822", "Silver:5730", "Bronze:10147"))) %>%
ggplot(aes(x=Level, y=Unique_sites, fill=Amino)) +
geom_bar(stat="identity") +
xlab("")
p + geom_text(aes(label = Unique_sites), position = position_stack(vjust =  0.8), size = 5) +
theme(text = element_text(size = 14))
